package visual;

import java.awt.Color;
import java.awt.Graphics;
import java.awt.Rectangle;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;

import javax.swing.JPanel;

import main.GameDef;

public class Piece extends JPanel implements MouseListener, GameDef{

	Rectangle area;
	logic.Piece piece;
	
	public Piece(logic.Piece _piece){
		piece = _piece;
		addMouseListener(this);
	}
	
	public void paint(Graphics g){
		/*g.setColor(getPieceColor(piece.type));
		for(int i = 0; i < piece.blocks.length; i++){
			g.fillRect(piece.blocks[i].position.x, piece.blocks[i].position.y, getParent().getWidth() / Board.WIDTH, getParent().getHeight() / Board.HEIGHT);
		}*/
	}
	
	public Color getPieceColor(int pieceType){
		switch(pieceType){
			case ID_INTERIOR:
				return new Color(COLOR_INTERIOR);
			case ID_HOUSE:
				return new Color(COLOR_HOUSE);
			case ID_CATAPULT:
				return new Color(COLOR_CATAPULT);
			case ID_CANNON:
				return new Color(COLOR_CANNON);
			case ID_ARMORY:
				return new Color(COLOR_ARMORY);
		}
		return new Color(COLOR_DEFAULT);
	}
	
	public void mouseClicked(MouseEvent e) {
		System.out.println("piece event: " + e);
	}

	public void mouseEntered(MouseEvent e) {
		// TODO Auto-generated method stub
	}

	public void mouseExited(MouseEvent e) {
		// TODO Auto-generated method stub
	}

	public void mousePressed(MouseEvent e) {
		// TODO Auto-generated method stub
	}

	public void mouseReleased(MouseEvent e) {
		// TODO Auto-generated method stub
	}

}
